<?php
declare (strict_types = 1);

$obj=new class {
    public $color="red";
    public $age=26;
};
function Ages(object &$obj)
{
    $obj->color="blue";
}
 
Ages($obj);
var_dump( $obj);
